<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
        1. 设置this = {}
        2. 将this的原型指向构造函数的原型（继承）
        3. 返回this
      */
      function Person() {
        // this = {}
        this.age = 20;
        this.uname = "lili";
        // this.__proto__ = Person.prototype;
        // return this;
      }
      const p1 = new Person();

      console.log(p1.age);
      console.log(p1.constructor);
      console.log(p1.__proto__.constructor);
      console.log(Person.prototype.constructor);
    </script>
  </body>
</html>
